package com.example.demo;

import com.example.demo.util.WebCrawlerUtil;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class DemoApplication {

	public static void main(String[] args) {
		SpringApplication.run(DemoApplication.class, args);
	}

	@Bean
	public CommandLineRunner commandLineRunner() {
		return args -> {
			String targetUrl = "https://www.iyunying.org/yunying/yyjc";
			System.out.println("开始抓取运营基础文章列表...");
			WebCrawlerUtil.safeCrawlAndPrint(targetUrl);
		};
	}
}
